﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace ShopCartOnline.Models
{
    [Table("NguoiDung")]
    public class NguoiDung
    {
        [Key]
        public int MaNguoiDung { get; set; }

        [Required]
        [Column(TypeName = "nvarchar")]
        [StringLength(50)]
        public string HoTen { get; set; }

        [Required]
        [Column(TypeName="bit")]
        [DefaultValue(false)]
        public bool GioiTinh { get; set; }

        [Required]
        public DateTime NgaySinh { get; set; }

        [Column(TypeName = "nvarchar")]
        [StringLength(100)]
        public string DiaChi { get; set; }

        [Column(TypeName = "varchar")]
        [StringLength(12)]
        public string SoDT { get; set; }

        [Required(ErrorMessage = "Vui lòng nhập email")]
        [DisplayName("Email")] 
        [Column(TypeName = "varchar")]
        [StringLength(50)]
        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}", ErrorMessage = "Nhập email không đúng !")] 
        public string Email { get; set; }


    }
}